/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Panier.java
 *
 * Created on 5 janv. 2009, 04:14:25
 */

package fr.miage.shopping.presentation.panel;

import fr.miage.shopping.presentation.CreationAdmin;
import fr.miage.shopping.presentation.CreationCategorie;
import fr.miage.shopping.presentation.CreationProduit;
import fr.miage.shopping.presentation.SelectionCategorie;
import fr.miage.shopping.presentation.SelectionProduit;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author romain
 */
public class Gestionnaire extends javax.swing.JPanel {

    DefaultTableModel model;

    /** Creates new form Panier */
    public Gestionnaire(boolean sup) {

        initComponents();
        if(!sup){
            jTabbedPane1.setEnabledAt(2, sup);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jCate = new javax.swing.JPanel();
        bCreateCate = new javax.swing.JButton();
        bModifCate = new javax.swing.JButton();
        jProd = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jUser = new javax.swing.JPanel();
        jButton4 = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 102, 0)), null));

        bCreateCate.setText("Créer une catégorie");
        bCreateCate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bCreateCateActionPerformed(evt);
            }
        });

        bModifCate.setText("Modifier une catégorie");
        bModifCate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bModifCateActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jCateLayout = new javax.swing.GroupLayout(jCate);
        jCate.setLayout(jCateLayout);
        jCateLayout.setHorizontalGroup(
            jCateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jCateLayout.createSequentialGroup()
                .addGap(75, 75, 75)
                .addGroup(jCateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(bModifCate)
                    .addComponent(bCreateCate))
                .addContainerGap(136, Short.MAX_VALUE))
        );

        jCateLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {bCreateCate, bModifCate});

        jCateLayout.setVerticalGroup(
            jCateLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jCateLayout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(bCreateCate)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(bModifCate)
                .addContainerGap(149, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Gestion des Catégories", jCate);

        jButton2.setText("Créer un produit");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Modifier un produit");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jProdLayout = new javax.swing.GroupLayout(jProd);
        jProd.setLayout(jProdLayout);
        jProdLayout.setHorizontalGroup(
            jProdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jProdLayout.createSequentialGroup()
                .addGap(88, 88, 88)
                .addGroup(jProdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton3)
                    .addComponent(jButton2))
                .addContainerGap(139, Short.MAX_VALUE))
        );
        jProdLayout.setVerticalGroup(
            jProdLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jProdLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton2)
                .addGap(18, 18, 18)
                .addComponent(jButton3)
                .addContainerGap(151, Short.MAX_VALUE))
        );

        jProdLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButton2, jButton3});

        jTabbedPane1.addTab("Gestion des Produits", jProd);

        jButton4.setText("Ajouter un gestionnaire ou superviseur");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jUserLayout = new javax.swing.GroupLayout(jUser);
        jUser.setLayout(jUserLayout);
        jUserLayout.setHorizontalGroup(
            jUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jUserLayout.createSequentialGroup()
                .addGap(54, 54, 54)
                .addComponent(jButton4)
                .addContainerGap(77, Short.MAX_VALUE))
        );
        jUserLayout.setVerticalGroup(
            jUserLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jUserLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton4)
                .addContainerGap(192, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Gestion des utilisateurs", jUser);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(17, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void bCreateCateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bCreateCateActionPerformed
        new CreationCategorie().setVisible(true);
    }//GEN-LAST:event_bCreateCateActionPerformed

    private void bModifCateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bModifCateActionPerformed
        new SelectionCategorie();
}//GEN-LAST:event_bModifCateActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        new SelectionProduit().setVisible(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        new CreationAdmin().setVisible(true);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        new CreationProduit().setVisible(true);
    }//GEN-LAST:event_jButton2ActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bCreateCate;
    private javax.swing.JButton bModifCate;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JPanel jCate;
    private javax.swing.JPanel jProd;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JPanel jUser;
    // End of variables declaration//GEN-END:variables



    
}
